function like(id,user) {
	var tblLike = document.getElementById('blike'+id);
	var tblDlike = document.getElementById('bdislike'+id);
	var jml = document.getElementById('jmllike'+id).innerHTML;
	//alert('jumlah='+jml);
	var jenis;
	//1=like, 2=dislike, 3=hapus
	
	if (tblLike.className!='islike') {
		jenis = 1;
	}else{
		jenis = 3;
	}
	
	xmlhttp=mintajax();
    xmlhttp.onreadystatechange=function()
    {
      if (xmlhttp.readyState== 4 && xmlhttp.status== 200)
      {
        if (jenis==1){
			tblLike.className = "islike";
			tblDlike.className = "notdislike";
			tblDlike.innerHTML = "";
		}else{
			tblLike.className = "like";
			tblDlike.className = "dislike";
			tblDlike.innerHTML = "<a href=\"javascript:dislike("+id+",'"+user+"');\"></a>";
		}
		document.getElementById('jmllike'+id).innerHTML = xmlhttp.responseText;
		//alert(xmlhttp.responseText);
      }
    }
    xmlhttp.open("GET","likekonten.php?id="+id+"&user="+user+"&jenis="+jenis+"&jml="+jml,true);
    xmlhttp.send(null);
}

function dislike(id,user) {
	var tblLike = document.getElementById('blike'+id);
	var tblDlike = document.getElementById('bdislike'+id);
	var jml = document.getElementById('jmllike'+id).innerHTML;
	//alert('jumlah='+jml);
	var jenis;
	//1=like, 2=dislike, 3=hapus
	
	if (tblDlike.className!='isdislike') {
		jenis = 2;
	}else{
		jenis = 4;
	}
	
	xmlhttp=mintajax();
    xmlhttp.onreadystatechange=function()
    {
      if (xmlhttp.readyState== 4 && xmlhttp.status== 200)
      {
        if (jenis==2){
			tblDlike.className = "isdislike";
			tblLike.className = "notlike";
			tblLike.innerHTML = "";
		}else{
			tblDlike.className = "dislike";
			tblLike.className = "like";
			tblLike.innerHTML = "<a href=\"javascript:like("+id+",'"+user+"');\"></a>";
		}
		document.getElementById('jmllike'+id).innerHTML = xmlhttp.responseText;
		//alert(xmlhttp.responseText);
      }
    }
    xmlhttp.open("GET","likekonten.php?id="+id+"&user="+user+"&jenis="+jenis+"&jml="+jml,true);
    xmlhttp.send(null);
}

function mlike(id,user) {
	var tblLike1 = document.getElementById('mlblike'+id);
	var tblDlike1 = document.getElementById('mlbdislike'+id);
	var tblLike2 = document.getElementById('mcblike'+id);
	var tblDlike2 = document.getElementById('mcbdislike'+id);
	var jml;
	var mana;
	if (document.getElementById('jmllikea'+id)){
		jml = document.getElementById('jmllikea'+id).innerHTML;
		mana=1;
	}else{
		jml = document.getElementById('jmllikeb'+id).innerHTML;
		mana=2;
	}
	var jenis;
	//1=like, 2=dislike, 3=hapus
	
	if (mana==1){
		if (tblLike1.className!='islike') {
			jenis = 1;
		}else{
			jenis = 3;
		}
	}else{
		if (tblLike2.className!='islike') {
			jenis = 1;
		}else{
			jenis = 3;
		}
	}
	
	xmlhttp=mintajax();
    xmlhttp.onreadystatechange=function()
    {
      if (xmlhttp.readyState== 4 && xmlhttp.status== 200)
      {
        if (jenis==1){
			if (tblLike1!=undefined){
				tblLike1.className = "islike";
				tblDlike1.className = "notdislike";
				tblDlike1.innerHTML = "";
			}
			if (tblLike2!=undefined){
				tblLike2.className = "islike";
				tblDlike2.className = "notdislike";
				tblDlike2.innerHTML = "";
			}
		}else{
			if (tblLike1!=undefined){
				tblLike1.className = "like";
				tblDlike1.className = "dislike";
				tblDlike1.innerHTML = "<a href=\"javascript:mdislike("+id+",'"+user+"');\"></a>";
			}
			if (tblLike2!=undefined){
				tblLike2.className = "like";
				tblDlike2.className = "dislike";
				tblDlike2.innerHTML = "<a href=\"javascript:mdislike("+id+",'"+user+"');\"></a>";
			}
		}
		if (tblLike1!=undefined) document.getElementById('jmllikea'+id).innerHTML = xmlhttp.responseText;
		if (tblLike2!=undefined)  document.getElementById('jmllikeb'+id).innerHTML = xmlhttp.responseText;
		//alert(xmlhttp.responseText);
      }
    }
    xmlhttp.open("GET","likekonten.php?id="+id+"&user="+user+"&jenis="+jenis+"&jml="+jml,true);
    xmlhttp.send(null);
}

function mdislike(id,user) {
	var tblLike1 = document.getElementById('mlblike'+id);
	var tblDlike1 = document.getElementById('mlbdislike'+id);
	var tblLike2 = document.getElementById('mcblike'+id);
	var tblDlike2 = document.getElementById('mcbdislike'+id);
	var jml;
	var mana;
	if (document.getElementById('jmllikea'+id)){
		jml = document.getElementById('jmllikea'+id).innerHTML;
		mana=1;
	}else{
		jml = document.getElementById('jmllikeb'+id).innerHTML;
		mana=2;
	}
	var jenis;
	//1=like, 2=dislike, 3=hapus
	
	if (mana==1){
		if (tblDlike1.className!='isdislike') {
			jenis = 2;
		}else{
			jenis = 4;
		}
	}else{
		if (tblDlike2.className!='isdislike') {
			jenis = 2;
		}else{
			jenis = 4;
		}
	}
	
	xmlhttp=mintajax();
    xmlhttp.onreadystatechange=function()
    {
      if (xmlhttp.readyState== 4 && xmlhttp.status== 200)
      {
        if (jenis==2){
			if (tblLike1!=undefined){
				tblDlike1.className = "isdislike";
				tblLike1.className = "notlike";
				tblLike1.innerHTML = "";
			}
			if (tblLike2!=undefined){
				tblDlike2.className = "isdislike";
				tblLike2.className = "notlike";
				tblLike2.innerHTML = "";
			}
		}else{
			if (tblLike1!=undefined){
				tblDlike1.className = "dislike";
				tblLike1.className = "like";
				tblLike1.innerHTML = "<a href=\"javascript:mlike("+id+",'"+user+"');\"></a>";
			}
			if (tblLike2!=undefined){
				tblDlike2.className = "dislike";
				tblLike2.className = "like";
				tblLike2.innerHTML = "<a href=\"javascript:mlike("+id+",'"+user+"');\"></a>";
			}
		}
		if (tblLike1!=undefined) document.getElementById('jmllikea'+id).innerHTML = xmlhttp.responseText;
		if (tblLike2!=undefined)  document.getElementById('jmllikeb'+id).innerHTML = xmlhttp.responseText;
		//alert(xmlhttp.responseText);
      }
    }
    xmlhttp.open("GET","likekonten.php?id="+id+"&user="+user+"&jenis="+jenis+"&jml="+jml,true);
    xmlhttp.send(null);
}